<?php
/**
 * Created by PhpStorm.
 * User: songdewei
 * Date: 2017/10/10
 * Time: 下午3:18
 */

namespace App\WeChat\WxApi;

use GuzzleHttp\Client;

class WxUserApi extends WxApi
{
    /**
     * @param $openid
     * @return mixed
     * @throws \Exception
     */
    public static function getInfo($openid){
        $uri = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=".self::getAccessToken()."&openid=$openid&lang=zh_CN";
        $client = new Client();
        $response = $client->get($uri);

        if ($response->getStatusCode() == 200) {
            return $response->getBody();
        } else {
            return false;
        }
    }
}
